import { Type } from "class-transformer";
import { IsNumber, IsOptional, IsString, MaxLength, ValidateNested } from "class-validator";
import { Pic } from "../../album/dto/create-album.dto";

export class TrackForm {

    @IsOptional()
    id?: number

    //专辑介绍
    @IsOptional()
    @IsString()
    @MaxLength(500, { message: "描述不超过500" })
    desc: string;

    //封面图
    @IsOptional()
    @ValidateNested()
    @Type(() => Pic)
    pic: Pic;

    //专辑标题
    @IsOptional()
    @IsString()
    @MaxLength(200, { message: "标题不超过200" })
    title: string;

    //专辑中歌曲列表
    @IsOptional()
    @IsNumber({ allowNaN: false }, { message: "歌曲id必须为数字类型", each: true })
    trackIds: number[]


    //专辑中歌曲类别列表
    @IsOptional()
    @IsNumber()
    tagIds: number[]

    // //专辑中歌曲列表
    // trackList: Song[];

}


export class FavoriteForm {
    @IsNumber()
    id: number;
  }